package ad.android.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import ad.android.util.Constants;

/**
 * TblApptype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tbl_apptype", catalog = Constants.CATALOG)
public class AppType implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 2597231298219571831L;
	private Long id;
	private String typeName;
	private Set<Application> tblApplications = new HashSet<Application>(0);

	// Constructors

	/** default constructor */
	public AppType() {
	}

	/** full constructor */
	public AppType(String typeName, Set<Application> tblApplications) {
		this.typeName = typeName;
		this.tblApplications = tblApplications;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "ID", unique = true, nullable = true)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "TYPE_NAME", length = 200)
	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tblApptype")
	public Set<Application> getTblApplications() {
		return this.tblApplications;
	}

	public void setTblApplications(Set<Application> tblApplications) {
		this.tblApplications = tblApplications;
	}

}